﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:localConverters ="clr-namespace:Video_katalog.Converters"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Video_katalog.HDDsManagerForm"
        WindowStartupLocation="CenterOwner" Title="Tvrdi diskovi" Height="278" Width="426" Loaded="Window_Loaded">
    <Window.Resources>
        <localConverters:SizeConverter x:Key="sizeConverter"/>
        <localConverters:DateConverter x:Key="dateConverter"/>
        <localConverters:ProgressBarValueToBackground x:Key="pogressBarValueToBackground"/>        
		<!-- Simple SimpleProgressBar
	    The template uses two Border controls to show the Track and Progress 
	    Limitations : It only supports a horizontal orientated ProgressBar -->
        <Style x:Key="SimpleProgressBar" TargetType="{x:Type ProgressBar}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <Grid>

                            <!-- This Border is the track. It must be named PART_Track -->
                            <Border x:Name="PART_Track" Background="{DynamicResource PressedBrush}" BorderBrush="#888" BorderThickness="1" CornerRadius="2"/>

                            <!-- This Border shows progress. It must be named PART_Indicator for the control to function -->
                            <Border HorizontalAlignment="Left" x:Name="PART_Indicator" BorderThickness="1" CornerRadius="2" BorderBrush="#FFBBC6C4" >
                                <Border.Background>
                                    <MultiBinding Converter="{StaticResource pogressBarValueToBackground}">
                                        <Binding ElementName="filledHddProgressBar" Path="Maximum"/>
                                        <Binding ElementName="filledHddProgressBar" Path="Value"/>
                                    </MultiBinding>
                                </Border.Background>
                            </Border>

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
    	<ComboBox x:Name="hddComboBox" Margin="8,56,0,0" Style="{DynamicResource SimpleComboBox}" IsSynchronizedWithCurrentItem="True" VerticalAlignment="Top" HorizontalAlignment="Left" Width="118.8" FontSize="16" ItemsSource="{Binding}" SelectionChanged="hddComboBox_SelectionChanged" MaxDropDownHeight="200" FontFamily="Trajan Pro" />
        <TextBlock x:Name="buyDateTB" Margin="90.198,106,0,0" TextWrapping="Wrap" Text="{Binding PurchaseDate, Converter={StaticResource dateConverter}}" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="13.333" FontWeight="Bold" Width="85"/>
        <TextBlock x:Name="warrantyLengthTB" HorizontalAlignment="Left" Margin="90.198,0,0,62.3" TextWrapping="Wrap" Text="{Binding WarrantyLength}" FontSize="13.333" FontWeight="Bold" Height="17.733" VerticalAlignment="Bottom" Width="74"/>
    	<TextBlock x:Name="capacityTB" HorizontalAlignment="Left" Margin="131.5,59.5,0,0" TextWrapping="Wrap" Text="{Binding}" VerticalAlignment="Top" FontSize="13.333" FontWeight="Bold" Width="57" TextAlignment="Center"/>
    	<TextBlock Margin="16,104,0,118.266" TextWrapping="Wrap" Text="Kupljen:" HorizontalAlignment="Left" FontSize="13.333" d:LayoutOverrides="Height"/>
    	<TextBlock HorizontalAlignment="Left" Margin="16,158.266,0,0" TextWrapping="Wrap" Text="Garancija:" VerticalAlignment="Top" FontSize="13.333"/>
    	<Grid Margin="192,9,0,0" Background="#FFE7E7E7" HorizontalAlignment="Left" VerticalAlignment="Top" Width="200" Height="215">
    		<Grid.Effect>
    			<DropShadowEffect/>
    		</Grid.Effect>
    		<Image Margin="0,0,0,66.283" Source="/Video%20Katalog;component/Resources/HDD1.png" HorizontalAlignment="Center">
    			<Image.OpacityMask>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="Black" Offset="0"/>
    					<GradientStop Color="#FFA94949" Offset="1"/>
    				</LinearGradientBrush>
    			</Image.OpacityMask>
    		</Image>
    		<TextBlock x:Name="freeSpacePercentage" Margin="0,0,23,52.3" TextWrapping="Wrap" Text="56 %" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="16" FontFamily="/Zavrsni Rad;component/Fonts/#Cambria Math"/>
    		<TextBlock x:Name="freeSpaceTB" Margin="77.9,0,0,12.5" TextWrapping="Wrap" Text="{Binding FreeSpace, Converter={StaticResource sizeConverter}}" VerticalAlignment="Bottom" FontSize="18.667" HorizontalAlignment="Left"/>
    		<TextBlock HorizontalAlignment="Left" Margin="15.25,0,0,14.176" TextWrapping="Wrap" Text="Slobodno:" VerticalAlignment="Bottom"/>
    		<ProgressBar x:Name="filledHddProgressBar" Height="17.191" Margin="8,0,8,34.136" Style="{DynamicResource SimpleProgressBar}" VerticalAlignment="Bottom"/>
        </Grid>
    	<TextBlock x:Name="warrantyValidTB" HorizontalAlignment="Left" Margin="90.198,181.7,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="13.333" FontWeight="Bold" Foreground="#FFE20707" Width="96"/>
    	<Button x:Name="addNewHddBTN" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="28" Height="28" ToolTip="Dodaj novi" Click="addNewHddBTN_Click">
    		<Image Height="20" Width="20" Source="/Video%20Katalog;component/Resources/plus20p.png" ToolTip="Dodaj novi"/>
    	</Button>
    	<Button x:Name="removeHddBtn" HorizontalAlignment="Left" Margin="40,8,0,0" VerticalAlignment="Top" Width="28" Height="28" ToolTip="Izbriši" Click="removeHddBtn_Click">
    		<Image Height="20" Width="20" Source="/Video%20Katalog;component/Resources/minus20p.png" ToolTip="Izbriši"/>
    	</Button>
    	<Button x:Name="editHddBTN" HorizontalAlignment="Left" Margin="72,8,0,0" VerticalAlignment="Top" Width="28" Height="28" ToolTip="Izmijeni" Click="editHddBTN_Click">
    		<Image Height="20" Width="20" Source="/Video%20Katalog;component/Resources/edit20p.png" ToolTip="Izmijeni"/>
    	</Button>
        
    </Grid>
</Window>
